<include file="Public:header" />
<load href="__JS__/upload/uploadify.css" />
<load href="__JS__/swfobject.js" />
<script type="text/javascript" src="__JS__/jquery.uploadify.v2.1.4.min.js"></script> 
<script type="text/javascript" src="__JS__/jianfanzhuanhuan.js"></script>
<div class="content">
<!-----------------------------------------内容开始--------------------------------------------------->
<div class="infoBox">
<form name="form" action="{:U('dowebs')}" method="post" onsubmit="return checkform();">
<input type="hidden" name="id" value="{$id}" />


<table width="100%" border="0" cellpadding="0" cellspacing="0" id="basic">
<tr>
<td width="11%" class="infoBoxTd">名称：</td>
<td colspan="2"><input type="text" name="name" value="{$name}" />
</td>
</tr>

<tr>
<td width="11%" class="infoBoxTd">网址：</td>
<td colspan="2"><input type="text" name="website" value="{$website}"  />
</td>
</tr>

<tr>
    <td class="infoBoxTd">网站包含分类：</td>
    <td colspan="2">
		<input type="hidden" name="menuid" id="menuid" value="{$menuid}" />
		<a href="javascript:;" id="selall_menuids" class="buttom">全选</a><br />
		<volist name="menus" id="menus">
			<span><input type="checkbox" name="menuids" value="{$menus.id}" class="checkboxml" <in name='menus.id' value='$menuid'>checked</in> /><span class="menu_name">{$menus.name}</span></span> 
		</volist>
	</td>
</tr>


</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="infoBoxTd">&nbsp;</td>
<td align="left">
	<input type="submit" name="Button1" value="保存" class="formInput01" />
</td>
</tr>
</table>
</form>
</div>
<!-----------------------------------------内容结束--------------------------------------------------->
</div>
<script language="javascript">

//表单验证
function checkform(){
	var n = $('input[name="name"]').val();
	if(n == ''){
		ui.error('请输入名称');
		return false;
	}
	var n = $('input[name="website"]').val();
	if(n == ''){
		ui.error('请输入网址');
		return false;
	}

}
$(document).ready(function(){
　　$("input[name='menuids']").on("click",function(){
		var gids = new Array();
		var gnames=new Array();
		$.each($("input[name='menuids']:checked"), function(i, n){
			gids.push($(n).val());
			var menu_name=$(this).parent().find("span.menu_name").text();
			gnames.push(menu_name);
			
		});
		
		var ids=gids.toString();
		$('#menuid').val(ids);
　　});
		//页面载入时判断分类项目
		var gnamess=new Array();
		$.each($("input[name='menuids']:checked"), function(){
			var menu_name=$(this).parent().find("span.menu_name").text();
			gnamess.push(menu_name);
			
		});

});
$(function() {   
	$("#selall_menuids").toggle(function() {   
		 $("input[name='menuids']").each(function() {   
		 $(this).attr("checked", true); 
		 });
		 
		var gids = new Array();
		$.each($("input[name='menuids']:checked"), function(i, n){
			gids.push( $(n).val() );
		});
		var ids=gids.toString();
		$('#menuid').val(ids);
		
	},function(){
		 $("input[name='menuids']").each(function() {   
		 $(this).attr("checked", false); 
		 }); 
		 
		var gids = new Array();
		$.each($("input[name='menuids']:checked"), function(i, n){
			gids.push( $(n).val() );
		});
		var ids=gids.toString();
		$('#menuid').val(ids);
		
	});

});

</script>
    

<include file="Public:footer" />
